package top.lenjon.lib.service.impl;

import org.apache.catalina.User;
import org.springframework.beans.factory.annotation.Autowired;
import top.lenjon.lib.entity.UserDetail;
import top.lenjon.lib.mapper.UserDetailMapper;
import top.lenjon.lib.service.IUserDetailService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 用户信息 服务实现类
 * </p>
 *
 * @author wei
 * @since 2020-11-09
 */
@Service
public class UserDetailServiceImpl extends ServiceImpl<UserDetailMapper, UserDetail> implements IUserDetailService {

    @Autowired
    UserDetailMapper userMapper;

    @Override
    public Integer getCountByUserName(String username) {
        return userMapper.getCountByUsername(username);
    }

    @Override
    public UserDetail getUserByUserName(String username) {
        return userMapper.getIdByUserName(username);
    }

    @Override
    public void activateUser(int id) {
        userMapper.setEnabledById(id);
    }

}
